Recently, in an apparatus for transmitting and receiving video and audio signals, a method by which the video and audio signals are coded to be digital signals to then be transmitted or stored in a memory and the digital signals are decoded to then be reproduced, has been widely adopted.
However, in the case of coding a video signal into digital data, the data quantity is large. Thus, in order to decrease the overall data quantity by removing redundant data contained in the digital video signal, discrete cosine transform (DCT) coding, differential pulse code modulation (DPCM), vector quantization, or variablelength coding (VLC) should be performed.
FIG. 1 is a schematic block diagram of a general coding system for image data. The apparatus includes means 11 and 12 for performing a DCT function with respect to an N×N block and for quantizing DCT coefficients, means 13 and 14 for variable-length-coding the quantized data and for further compressing data quantity, and means 15, 16, 17, 18, 19, A1, A2, SW1 and SW2 related to the inverse quantization and DCT operations with respect to the quantized data to then perform a motion compensation, which codes image data in an intra mode or inter mode.
FIG. 2 is a schematic block diagram of a general decoding system for image data. The apparatus decodes and reproduces the image data coded by the coding system shown in FIG. 1.
The operation of the coding and decoding systems respectively shown in FIGS. 1 and 2 will be briefly described.
In FIG. 1, the video signal input through an input port 10 becomes a signal of a frequency domain in the units of N×N blocks in DCT 11, where although the magnitude of a block is generally N1×N2, it is assumed that N1=N2=N, for the sake of convenience. The energy of transform coefficients is chiefly concentrated in a low frequency domain. Data transforms for each block are performed by a discrete cosine transform. Walsh-Hadamard transform, discrete Fourier transform, or discrete sine transform method. Here, the transform coefficients are obtained by DCT operation.
Quantizer 12 changes the DCT coefficients into representative values of a constant level through a predetermined quantization process.
Variable-length encoder 13 variable-length-codes the representative values using their statistical characteristics, thereby further compressing the data.
Meanwhile, a quantization step size Qss, which is varied depending on the state (a fullness) of a buffer 14 wherein the variable-length-coded data is stored, controls quantizer 12 to thereby adjust a transmission bit rate. The quantization step size Qss is also transmitted to a receiver side, to be used in a decoding system.
Also, in general, there are many similar portions between consecutive screens. Therefore, in the case of a screen having motion, a motion vector MV is obtained by estimating the motion, and data is compensated using the motion vector MV. Then, a differential signal between adjacently positioned screens becomes very small, thereby allowing transmission data to be more compressed.
In order to perform such motion compensation, an inverse quantizer (Q−1) 15 shows in FIG. 1 inverse-quantizes the quantized data output from quantizer 12. Thereafter, the inverse-quantized data is inverse-DCT-operated in an inverse DCT means (DCT−1) 16 to then be a video signal of a spatial domain. The video signal output from inverse DCT means 16 is stored in a frame memory 17 in frame units. Motion estimator 18 searches a block having the most similar pattern to that of an N×N block of input port 10 among the frame data stored in frame memory 17 and estimates the motion between blocks to obtain a motion vector MV. The motion vector MV is transmitted to a receiver side to be used in a decoding system and is simultaneously transmitted to a motion compensator 19.
Motion compensator 19 receives the motion vector MV from motion estimator 18 and reads out an N×N block corresponding to the motion vector MV from the previous frame data output from frame memory 17 to then supply the read N×N block to a subtractor Al connected with input port 10. Then, subtractor A1 obtains the difference between the N×N block supplied to input port 10 and the N×N block having the similar pattern thereto supply from motion compensator 19. The output data of subtractor Al is coded and then transmitted to the receiver side, as described above. That is to say, initially, the video signal of one screen (intraframe) is coded wholly to then be transmitted. For the video signal of the following screen (interframe), only the differential signal due to the motion is coded to then be transmitted.
Meanwhile, the data whose motion is compensated in motion compensator 19 is summed with the video signal output from inverse DCT means 16 in an adder A2 and is thereafter stored in frame memory 17.
Refresh switches SW1 and SW2 are turned off at a certain interval (here, the period is one group of pictures or a GOP period) by a control means (not shown), so that an input video signal is coded into a PCM mode to then be transmitted in the case of an intraframe mode and so that only the differential signal is coded to then be transmitted in the case of an interframe mode, thereby refreshing cumulative coding errors for a constant period (one GOP). Also, a refresh switch SW3 allows the transmission errors on a channel to deviate from the receiver side within the constant time period (one GOP).
In this manner, the coded image data Vc is transmitted to the receiver side to then be input to the decoding system shown in FIG. 2. The coded image data Vc is decoded through the reverse process to the coding process in a variable-length decoder 21. The data output from variable-length decoder 21 is inverse-quantized in an inverse quantizer 22. At this time, inverse quantizer 22 adjusts the magnitude of the output DCT coefficients depending on the quantization step size Qss supplied from the encoding system.
An inverse DCT means 23 inverse-DCT-operates the DCT coefficients of a frequency domain, supplied from inverse quantizer 22, into the image data of a spatial domain.
Also, the motion vector MV transmitted from coding system shown in FIG. 1 is supplied to a motion compensator 24 of decoding system. Motion compensator 24 reads out the N×N block corresponding to the motion vector MV from the previous frame data stored in a frame memory 25, compensates the motion and then supplies the compensated N×N block to an adder A3. Then, adder A3 adds the inverse-DCT-operated DPCM data to the N×N block data supplied from motion compensator 24 to then output to a display.
FIGS. 3A, 3B and 3C schematically show the process of coding image data. The sampling data of an N×N block shown in FIG. 3A is DCT-operated to be DCT coefficients of a frequency domain by the DCT method, etc., as shown in FIG. 3B. The DCT coefficients are quantized and are scanned in a zigzag pattern, to then be coded in the form of runlength and level-length, as shown in FIG. 3C.
While the scanning is performed from a low frequency component to a high frequency component in scanning the N×N block, as shown in FIG. 3C, a “run” and “level” and set as a pair expressed as [run, level], and is then coded.
Here, the run represents the number of 0's present between coefficients not being “0” among the quantized coefficients of an N×N block, and the level corresponds to the absolute value of the coefficient not being “0”.
For example, in the case of an 8×8 block, the run is distributed from “0” to “63” and the level varies depending to the data value output from a quantizer. That is to say, if the quantized output value is indicated as an integer ranging from “−255” to “+255,” the level has a value ranging from “1” to “+255.” At this time, the positive or negative sign is expressed by an extra sign bit. In this manner, when a [run, level] pair is set as a symbol, if the run or level is large, the probability of the symbol is statistically very low.
Therefore, as shown in FIG. 4, the block is divided into a regular region and an escape region according to the probability of the symbol. For the regular region where the probability of the symbol is relatively high, a Huffman code is used in coding. For the escape region where the probability of the symbol is low, data of a predetermined fixed length is used in coding. Here, according to the Huffman code, the higher the probability of the symbol, the shorter the code is set, and vice versa.
Also, the escape sequence ESQ in which data of escape region is coded is composed of an escape code ESC, run, level and sign data S, each having a predetermined number of bits, as expressed in the following equation (1).ESQ=ESC +RUN +L +S  (1)
For example, as described above, if the quantized value is from “−255” to “+255” in an 8×8 block, the escape sequence has a constant data length of 21 bits in total since the escape code data ESC is six bits, run data RUN is six bits, level data L is eight bits, and sign data S is one bit.
In this manner, according to the conventional variable-length coding method, since various extra information is also transmitted together with coded data and the escape sequence set by one variable-length coding table depending on the statistical characteristics of data has a constant fixed length, there is a limit in compressing data quantity by coding transmitted data.